package com.itheima;

import java.util.ArrayList;
import java.util.Collection;

public class Demo05 {

    public static void main(String[] args) {

        /*
            boolean add(E e)             添加元素
            boolean remove(Object o)    从集合中移除指定的元素
            void clear()                清空集合中的元素
            boolean contains(Object o)  判断集合中是否存在指定的元素
            boolean isEmpty()           判断集合是否为空
            int size()                  集合的长度，也就是集合中元素的个数
         */


        Collection<String> collection = new ArrayList<>();

        boolean q = collection.add("乔碧萝");
        System.out.println(q);

        /*boolean remove = collection.remove("乔碧萝");
        System.out.println(remove);*/

        //collection.clear();

        boolean contains = collection.contains("乔碧萝");
        System.out.println(contains);

        boolean empty = collection.isEmpty();
        System.out.println(empty);

        System.out.println(collection.size());

        System.out.println(collection);

    }
}





